import {
	SETUSERINFO
} from '../actions/reglogin';

function user(state = {
	uid: 0,
	token: "",
	avatar: "",
	nick: "",
	sex: 0
}, action) {
	switch (action.type) {
		case SETUSERINFO:
			return Object.assign({},state, {
				uid: action.uid,
                token: action.token,
				avatar: action.avatar,
				nick: action.nick,
				sex: action.sex
			});
		default:
			return state
	}
}

export default user;